﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SundayWishModel.Entities;
using SundayWishBLL;

public partial class User_changepassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ContentPlaceHolder UserMaster = (ContentPlaceHolder)Page.Master.Master.FindControl("ContentPlaceHolder1");
        ((Label)UserMaster.FindControl("lbpagename")).Text = "修改密码";
        ((HyperLink)UserMaster.FindControl("hlchangepassword")).CssClass = "select_page";
    }

    protected void btchange_Click(object sender, EventArgs e)
    {
        UserHelper uh = new UserHelper();
        if (uh.ChangePassword(((UserInfo)Session["user"]).UserId, tbOldPassword.Text, tbNewPassword.Text))
        {
            WebHelper.AlertMsg("a", "修改成功");
        }
        else
        {
            WebHelper.AlertMsg("a", "旧密码不正确");
        }

    }
}
